package com.gof.example.prototype.prototypemanager;

/**
 * Created with IntelliJ IDEA.
 * Created by zhiyuan on 2018/5/3 09:05.
 * haiming.fei@tongdun.cn
 */
public class App {

    public static void main(String[] args) throws CloneNotSupportedException {
        PrototypeManager instance = PrototypeManager.getInstance();

        OfficeDocument far = instance.getDoc("far");
        far.display();
        OfficeDocument far1 = instance.getDoc("far");
        far1.display();
        System.out.println(far == far1);

        OfficeDocument srs = instance.getDoc("srs");
        srs.display();
        OfficeDocument srs1 = instance.getDoc("srs");
        srs1.display();
        System.out.println(srs == srs1);

        OfficeDocument ppr = instance.getDoc("ppr");
        ppr.display();
        OfficeDocument ppr1 = instance.getDoc("ppr");
        ppr1.display();
        System.out.println(ppr == ppr1);

        OfficeDocument ttr = instance.getDoc("ttr");
        ttr.display();
        OfficeDocument ttr1 = instance.getDoc("ttr");
        ttr1.display();
        System.out.println(ttr == ttr1);
    }
}
